package com.wx.app.card.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wx.app.card.dao.entity.CardEntity;
import com.wx.app.card.dao.mapper.CardMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 类功能描述：
 *
 * @author：刘富国
 * @createTime：2019/7/30 19:43
 */
@Api(tags = "C图鉴")
@Slf4j
@RestController
public class CardImageController extends BaseController {

    @Autowired
    private CardMapper cardMapper;


    /**
     * 图鉴
     */
    @ApiOperation(value = "获取图鉴列表")
    @PostMapping("/card/all")
    public Object all(@RequestHeader String token) {
        List<CardEntity> cardEntities = cardMapper.selectList(new QueryWrapper<CardEntity>().orderByAsc("year"));
        return success(cardEntities);
    }
}
